<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        /* 正常情况下的显示 */
        .container {
            width: 750px;
            background-color: red;
            margin: 0 auto;
            overflow: hidden;
        }

        li {
            float: left;
            width: 93.75px;
            height: 30px;
            list-style: none;
        }
        /* 当宽度小于767px宽度显示 */
        @media screen and (max-width:767px) {
            .container {
                width: 100%;
            }

            li {
                float: left;
                width: 33.33%;
                height: 30px;
            }
        }

    </style>
</head>

<body>
    <div class="container">
        <ul>
            <li>导航1</li>
            <li>导航2</li>
            <li>导航3</li>
            <li>导航4</li>
            <li>导航5</li>
            <li>导航6</li>
            <li>导航7</li>
            <li>导航8</li>
        </ul>
    </div>
</body>

</html>